import logging,HTMLTestRunner_cn
import time

import HTMLTestRunner_PY3
import yagmail


class Tools:
    def Log(self):
        times=time.strftime("%Y_%m_%d %H_%M_%S")
        log=logging.basicConfig(level=logging.INFO,
                                format='%(filename)s %(levelname)s %(asctime)s %(message)s %(lineno)d',
                                filename='pyt'+ times +'.log',
                                filemode='a+')
        return log
    def baogao(self):
        return HTMLTestRunner_PY3.HTMLTestRunner(
            open('./baogao.html','wb'),
            title='测试报告',
            description='测试报告'
        )

    # def Report(self):
    #     report1 = HTMLTestRunner_cn.HTMLTestRunner(
    #         open(r'C:\Users\34098\PycharmProjects\gao5\week3lianxi\TestReport.html', 'wb'),
    #         title='测试报告',
    #         description='测试报告'
    #     )
    #     return report1
    #
    # def email(self):
    #     emaill = yagmail.SMTP(user='3409851406@qq.com',password='',host='smtp.qq.com')
    #     emaill.send(to='3409851406@qq.com',)



